package com.et.mserver;

import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class PrefixedXMLStreamCodecFactory implements ProtocolCodecFactory {

	private final PrefixedXMLStreamEncoder encoder;
	private final PrefixedXMLStreamDecoder decoder;

	public PrefixedXMLStreamCodecFactory() {
		this.encoder = new PrefixedXMLStreamEncoder();
		this.decoder = new PrefixedXMLStreamDecoder();
	}

	public ProtocolDecoder getDecoder(final IoSession session) throws Exception {
		return decoder;
	}

	public ProtocolEncoder getEncoder(final IoSession session) throws Exception {
		return encoder;
	}

}

